<%--
  Created by IntelliJ IDEA.
  User: zgf
  Date: 2018/12/20
  Time: 15:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path =request.getContextPath();
%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>${name}GGB统计局大数据平台</title>

    <link href="<%=path%>/static/css/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="<%=path%>/static/js/jquery-1.8.3.min.js"></script>
</head>
<body onLoad="sendRequest()" >

<div class="videozz"></div>
<video  autoplay muted loop poster="<%=path%>/static/images/fallba1ck.jpg">
    <source src="<%=path%>/static/images/mov.mp4">
    你的游览器不支持video支持
</video>

<div class="box">
    <div class="box-a">
        <div class="m-2">
            <div class="m-2-1">
                <form action="<%=path%>/user/login" method="post">
                    <h3 style="color: red;">${msg}</h3>
                    <div class="m-2-2">
                        <input type="text" name="username" placeholder="请输入账号" autocomplete="off"/>
                    </div>
                    <div class="m-2-2">
                        <input type="password" style="display:none">
                        <input type="password" name="password" placeholder="请输入密码" autocomplete="new-password"/>
                    </div>
                    <div class="m-2-2-1">
                        <input name="code" placeholder='验证码' maxlength="4" type='text' name="ValidateNum" autocomplete="off">
                        <canvas class="J_codeimg" id="myCanvas" onclick="Code();" style="width:93px;height:31px; align-content: center; margin-top: 5px;background-color: #015c79;">对不起，您的浏览器不支持canvas，请下载最新版浏览器!</canvas>
                    </div>
                    <div class="m-2-2">
                        <button type="submit" value="登录" /> 登录

                    </div>

                </form>
            </div>
        </div>
        <div class="m-5">
            <div id="m-5-id-1">
                <div id="m-5-2">
                    <div id="m-5-id-2">
                    </div>
                    <div id="m-5-id-3"></div>
                </div>
            </div>
        </div>
        <div class="m-10"></div>
        <div class="m-xz7"></div>
        <div class="m-xz8 xzleft"></div>
        <div class="m-xz9"></div>
        <div class="m-xz9-1"></div>
        <!-- <div class="m-x10"></div>
        <div class="m-x11"></div>
        <div class="m-x12 xzleft"></div>
        <div class="m-x13"></div>
        <div class="m-x14 xzleft"></div>
        <div class="m-x15"></div>
        <div class="m-x16 xzleft"></div>-->
        <div class="m-x17 xzleft"></div>
        <div class="m-x18"></div>
        <div class="m-x19 xzleft"></div>
        <div class="m-x20"></div>
        <div class="m-8"></div>
        <div class="m-9"><div class="masked1" id="sx8">GGB统计局大数据平台</div></div>
        <div class="m-11">
            <div class="m-k-1"><div class="t1"></div></div>
            <div class="m-k-2"><div class="t2"></div></div>
            <div class="m-k-3"><div class="t3"></div></div>
            <div class="m-k-4"><div class="t4"></div></div>
            <div class="m-k-5"><div class="t5"></div></div>
            <div class="m-k-6"><div class="t6"></div></div>
            <div class="m-k-7"><div class="t7"></div></div>
        </div>
        <div class="m-14"><div class="ss"></div></div>
        <div class="m-15-a">
            <div class="m-15-k">
                <div class="m-15xz1">
                    <div class="m-15-dd2"></div>
                </div>
            </div>
        </div>
        <div class="m-16"></div>
        <div class="m-17"></div>
        <div class="m-18 xzleft"></div>
        <div class="m-19"></div>
        <div class="m-20 xzleft"></div>
        <div class="m-21"></div>
        <div class="m-22"></div>
        <div class="m-23 xzleft"></div>
        <div class="m-24" id="localtime"></div>
    </div>
</div>
<script src="<%=path%>/static/js/common.min.js"></script>
<script type="text/javascript">
    var canGetCookie = 0;//是否支持存储Cookie 0 不支持 1 支持
    var CodeVal = 0;
    Code();
    function Code() {
        if(canGetCookie == 1){
            createCode("AdminCode");
            var AdminCode = getCookieValue("AdminCode");
            showCheck(AdminCode);
        }else{
            showCheck(createCode(""));
        }
    }
    function showCheck(a) {
        CodeVal = a;
        var c = document.getElementById("myCanvas");
        var ctx = c.getContext("2d");
        ctx.clearRect(0, 0, 1000, 1000);
        ctx.font = "80px 'Hiragino Sans GB'";
        ctx.fillStyle = "#E8DFE8";
        ctx.fillText(a, 0, 100);
    }
    //生成验证码
    var code = "";
    function createCode(e) {
        code = "";
        var codeLength = 4;
        var selectChar = new Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
        for (var i = 0; i < codeLength; i++) {
            var charIndex = Math.floor(Math.random() * 60);
            code += selectChar[charIndex];
        }
        if (code.length != codeLength) {
            createCode(e);
        }
        if(canGetCookie == 1){
            setCookie(e, code, 60 * 60 * 60, '/');
        }else{
            return code;
        }
    }
</script>
<div style="text-align:center;">
    <p><a href="" target="_blank"></a></p>
</div>
</body>
</html>
